﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ICM_Inventory_Stock_Taking.aspx.cs" Inherits="KPIS.GERP.GIMS.APP.APP_UI.Edit_Form.ICM_Inventory_Stock_Taking" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
    <title>รายละเอียดการตรวจนับพัสดุ</title>
    <link rel="StyleSheet" href="../../Styles/StyleSheet.css" type="text/css"/>
</head>
<body>
    <form id="form1" runat="server">
         <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" >
         </asp:ScriptManager>
           <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
              <script type="text/javascript" src="../../Scripts/Common.js"></script>
              <script type="text/javascript">
              function onTextChangeGeneral(sender) {
                    if (sender.get_value() == "") {
                        sender.set_text("");
                    }
                }
                function GetRadWindow() 
               {
                    var oWindow = null;
                    if (window.radWindow)
                        oWindow = window.RadWindow; 
                    else if (window.frameElement.radWindow)
                        oWindow = window.frameElement.radWindow; 
                    return oWindow;
                }
               function CloseWindow() 
               {
                     GetRadWindow().Close();
               }
              </script>
           </telerik:RadCodeBlock> 
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
                   <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="Panel1">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1" />
                                <telerik:AjaxUpdatedControl ControlID="Panel2" LoadingPanelID="RadAjaxLoadingPanel1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                        <telerik:AjaxSetting AjaxControlID="Panel2">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1" />
                                <telerik:AjaxUpdatedControl ControlID="Panel2" LoadingPanelID="RadAjaxLoadingPanel1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                   </AjaxSettings>
           </telerik:RadAjaxManager>
           <div class="moduleContent1000">
              <div class="moduleDivBottom1000">
                 <asp:Panel ID="Panel2" runat="server" CssClass="contentPaneDiv" Height="30px" ScrollBars="Auto" >
                            <table cellpadding="0" cellspacing="0">
                                <tr class="command-list">
                                    <td>
                                        <asp:LinkButton ID="btnAdd" runat="server" CssClass="LinkButton" onclick="btnAdd_Click">
                                            <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/AddRecord.gif" />&nbsp;&nbsp;เพิ่มข้อมูลใหม่
                                        </asp:LinkButton>
                                    </td>
                                    <td class="command-item">
                                        <asp:Label ID="hStatus" runat ="server" Visible = "false" />
                                        <asp:LinkButton ID="btnSave" runat="server" CssClass="LinkButton"  onclick="btnSave_Click">
                                            <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Cmd_Save.gif" />&nbsp;&nbsp;บันทึกข้อมูล
                                        </asp:LinkButton>
                                    </td>
                                    <td class="command-item">
                                        <asp:LinkButton ID="btnCancel" runat="server" CssClass="LinkButton" OnClick="btnCancel_Click">
                                            <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Cancel.gif" />&nbsp;&nbsp;ยกเลิกข้อมูล
                                        </asp:LinkButton>
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                 </div>
           </div>
           <div class="moduleContent1000">
                  <div class="moduleDivBottom1000">
                     <asp:Panel ID="Panel1" runat="server" CssClass="contentPaneDiv" Height="409px" ScrollBars="Auto" align = "left" >    
                                 <div class="header-grid" align="left">
                                           <asp:Label ID="lblHeaderList" runat="server" Text="รายการตรวจนับ" ></asp:Label>
                                 </div>
                                 <table>
                                           <tr>
                                                    <td align="center">
                                                             <telerik:RadGrid ID="grdStockTaking" runat="server" AutoGenerateColumns="false" 
                                                                                    AllowMultiRowEdit="false" AllowMultiRowSelection="true" ShowStatusBar="true"
                                                                                    Width="922px" Height="199px" AllowPaging="true" AllowFilteringByColumn="true"
                                                                                    GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
                                                                                    GroupingSettings-GroupContinuedFormatString=""
                                                                                    GroupingSettings-GroupContinuesFormatString=""
                                                                                    GroupingSettings-GroupSplitFormat=""
                                                                                    OnNeedDataSource="grdStockTaking_NeedDataSource"
                                                                                    OnItemCommand="grdStockTaking_ItemCommand" align ="left">
                                                                                    <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" GroupLoadMode="Client"
                                                                                        DataKeyNames="icm_stock_taking_item_seq" NoMasterRecordsText="< ไม่มีข้อมูล >" GroupsDefaultExpanded="true">
                                                                                        <RowIndicatorColumn>
                                                                                            <HeaderStyle Width="20px" />
                                                                                        </RowIndicatorColumn>
                                                                                        <ExpandCollapseColumn>
                                                                                            <HeaderStyle Width="20px" />
                                                                                        </ExpandCollapseColumn>
                                                                                        <Columns>   
                                                                                            <telerik:GridTemplateColumn AllowFiltering="false" UniqueName="Edit" HeaderText="แก้ไข" HeaderStyle-Width="40px" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center"> 
                                                                                                <FilterTemplate></FilterTemplate>
                                                                                                <ItemTemplate>
                                                                                                    &nbsp;&nbsp;&nbsp;
                                                                                                        <asp:ImageButton ID="cmdEdit" runat="server" CommandName="DataEdit"
                                                                                                            ImageUrl="~/App_UI/Images/Buttons/Edit.gif" 
                                                                                                            ToolTip="แก้ไขรายการ" width="17" />    
                                                                                                </ItemTemplate>
                                                                                            </telerik:GridTemplateColumn>
                                                                                            <telerik:GridTemplateColumn AllowFiltering="false" UniqueName="Delete" HeaderText="ลบ" HeaderStyle-Width="40px" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center"> 
                                                                                                <FilterTemplate></FilterTemplate>
                                                                                                <ItemTemplate>
                                                                                                    &nbsp;&nbsp;&nbsp;
                                                                                                         <asp:ImageButton ID="cmdDelete" runat="server" CommandName="DataDelete"
                                                                                                            ImageUrl="~/App_UI/Image/Grid/Delete.gif" OnClientClick="javascript:return confirm('ยืนยันการลบข้อมูลที่เลือก')"
                                                                                                            ToolTip="ลบรายการ" width="17" /> 
                                                                                                </ItemTemplate>
                                                                                            </telerik:GridTemplateColumn>
                                                                                            <telerik:GridBoundColumn DataField="icm_stock_taking_item_seq" 
                                                                                                UniqueName="icm_stock_taking_item_seq"
                                                                                                FilterControlWidth="100%" AutoPostBackOnFilter="true" 
                                                                                                CurrentFilterFunction="Contains" ShowFilterIcon="false" Visible="false" >
                                                                                            </telerik:GridBoundColumn>
                                                                                            <telerik:GridBoundColumn DataField="icm_res_item_seq" 
                                                                                                UniqueName="icm_res_item_seq"
                                                                                                FilterControlWidth="100%" AutoPostBackOnFilter="true" 
                                                                                                CurrentFilterFunction="Contains" ShowFilterIcon="false" Visible="false" >
                                                                                            </telerik:GridBoundColumn>
                                                                                            <telerik:GridBoundColumn DataField="icm_stock_taking_code" 
                                                                                                HeaderText="รหัสการตรวจนับ" UniqueName="icm_stock_taking_code" HeaderStyle-Width="90px" 
                                                                                                FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                                                                CurrentFilterFunction="Contains" ShowFilterIcon="false" 
                                                                                                HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                                            </telerik:GridBoundColumn>
                                                                                            <telerik:GridBoundColumn DataField="resource_name" 
                                                                                                HeaderText="รายการ" UniqueName="resource_name" 
                                                                                                FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                                                                CurrentFilterFunction="Contains" ShowFilterIcon="false" 
                                                                                                HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                                            </telerik:GridBoundColumn>
                                                                                            <telerik:GridBoundColumn DataField="quanlity_amount_stock" 
                                                                                                HeaderText="จำนวนในระบบ(หน่วย)" UniqueName="quanlity_amount_stock" 
                                                                                                FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                                                                CurrentFilterFunction="Contains" ShowFilterIcon="false" 
                                                                                                HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                                            </telerik:GridBoundColumn>
                                                                                             <telerik:GridBoundColumn DataField="quantity_amount_real" 
                                                                                                HeaderText="จำนวนที่มีอยู่จริง(หน่วย)" UniqueName="quantity_amount_real" 
                                                                                                FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                                                                CurrentFilterFunction="Contains" ShowFilterIcon="false" 
                                                                                                HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                                            </telerik:GridBoundColumn>
                                                                                            <telerik:GridBoundColumn DataField="remark" 
                                                                                                HeaderText="หมายเหตุเพิ่มเติม" UniqueName="remark" 
                                                                                                FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                                                                CurrentFilterFunction="Contains" ShowFilterIcon="false" 
                                                                                                HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                                            </telerik:GridBoundColumn>
                                                                                        </Columns>
                                                                                        <PagerStyle Mode="NumericPages" AlwaysVisible="true" 
                                                                                            FirstPageToolTip="กลับหน้าแรก" LastPageToolTip="ไปหน้าสุดท้าย" 
                                                                                            NextPagesToolTip="หน้าถัดไป" NextPageToolTip="หน้าถัดไป" 
                                                                                            PrevPagesToolTip="ย้อนกลับ" PrevPageToolTip="ย้อนกลับ" />
                                                                                        </MasterTableView>
                                                                            <GroupingSettings GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;" 
                                                                                GroupContinuedFormatString="" GroupContinuesFormatString="" 
                                                                                GroupSplitFormat="" />
                                                                            <ClientSettings EnableRowHoverStyle="True">
                                                                                <Selecting AllowRowSelect="true" />
                                                                                <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                                                                            </ClientSettings>
                                                                        </telerik:RadGrid> 
                                                    </td>
                                           </tr>
                                 </table>
                                 <div class="formList-detail">
                                     <table>
                                         <tr>
                                                <td valign="top" width="150px">
                                                    <asp:Label CssClass="font-label" runat = "server" ID= "lblStockTakingCode" Text = "รหัสการตรวจนับ         : " Font-Bold="true"/>
                                                </td>
                                                <td>
                                                    <asp:Label CssClass="font-label" runat = "server" ID= "pStockTakingCode"  Font-Bold="true"/>    
                                                </td>  
                                         </tr>
                                     </table>
                                 </div>
                                 <div class="formList-detail">
                                       <table>
                                             <tr>
                                                    <td valign="top" width="120px">
                                                        <asp:Label CssClass="font-label" runat = "server" ID= "lblChooseInventoryItem" Text = "รายการพัสดุ           : " Font-Bold="true"/>
                                                    </td>
                                                    <td>
                                                        <telerik:RadComboBox ID="cmbChooseInventoryItem" runat="server" 
                                                                AllowCustomText="true" EmptyMessage="< รายการวัสดุ >" 
                                                                EnableLoadOnDemand="true" EnableVirtualScrolling="true" Height="230px" 
                                                                HighlightTemplatedItems="true" MarkFirstMatch="false" AutoPostBack ="true"
                                                                OnClientTextChange="onTextChangeGeneral" 
                                                                OnItemsRequested="cmbChooseInventoryItem_ItemsRequested" OnSelectedIndexChanged="cmbChooseInventoryItem_OnSelectedIndexChanged"
                                                                ShowDropDownOnTextboxClick="true" ShowMoreResultsBox="true" Width="740px">
                                                                <HeaderTemplate>
                                                                    <table cellpadding="0" cellspacing="0" class="font-label">
                                                                        <tr>
                                                                            <td align="center" width="150px"><b>รหัสวัสดุ</b></td>
                                                                            <td align="center" width="200px"><b>ชื่อวัสดุ</b></td>
                                                                            <td align="center" width="200px"><b>รายละเอียดของวัสดุ</b></td>
                                                                        </tr>
                                                                    </table>
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <asp:Table ID="tableInventoryItem" runat="server" CellPadding="0" 
                                                                        CellSpacing="0" CssClass="font-label">
                                                                    </asp:Table>
                                                                </ItemTemplate>
                                                            </telerik:RadComboBox>
                                                            &nbsp;<label id="Label26" runat="server"><font color="red">*</font></label>
                                                    </td>  
                                             </tr>
                                       </table>
                                 </div>
                                 <div class="formList-detail">
                                     <table>
                                         <tr>
                                                <td valign="top" width="150px">
                                                    <asp:Label CssClass="font-label" runat = "server" ID= "lblAmountStock" Text = "จำนวนพัดสุที่มีอยู่ในระบบ         : " Font-Bold="true"/>
                                                </td>
                                                <td>
                                                    <telerik:RadNumericTextBox ID="pAmountStock" runat="server" MaxLength="20" title="จำนวนที่มีอยู่จริง" Width="111" NumberFormat-GroupSeparator="," NumberFormat-DecimalDigits="0" Enabled="false"></telerik:RadNumericTextBox>   
                                                </td>  
                                                <td>
                                                    <asp:Label CssClass="font-label" runat = "server" ID="lblUnitName" Font-Bold="true" Text ="หน่วย" />
                                                </td>
                                                <td>
                                                    <asp:Label CssClass="font-label" runat = "server" ID= "lblStockReal" Text = "จำนวนพัดสุที่มีอยู่จริง        : " Font-Bold="true"/>
                                                </td>
                                                <td>
                                                    <telerik:RadNumericTextBox ID="txtStockReal" runat="server" MaxLength="20" title="จำนวนที่มีอยู่จริง" Width="111" NumberFormat-GroupSeparator="," NumberFormat-DecimalDigits="0" ></telerik:RadNumericTextBox>
                                                </td>  
                                                <td>
                                                    <asp:Label CssClass="font-label" runat = "server" ID="Label1" Font-Bold="true" Text ="หน่วย" />
                                                </td>
                                         </tr>
                                     </table>
                                 </div>
                                 <div class="formList-detail">
                                     <table>
                                         <tr>
                                                <td valign="top" width="150px">
                                                    <asp:Label CssClass="font-label" runat = "server" ID= "lblRemark" Text = "หมายเหตุเพิ่มเติม        : " Font-Bold="true"/>
                                                </td>
                                                <td>
                                                    <telerik:RadTextBox ID="txtRemark" runat="server" title="หมายเหตุเพิ่มเติม" Width="740px"  ></telerik:RadTextBox> 
                                                </td>  
                                         </tr>
                                     </table>
                                 </div>
                     </asp:Panel>
              </div>
          </div>                                      
    </form>
</body>
</html>
